package com.qqla.controller;


import com.qqla.dto.StudyQueryPage;
import com.qqla.entity.Study;
import com.qqla.result.PageResult;
import com.qqla.result.ResponseResult;
import com.qqla.service.StudyService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/user/home")
@RequiredArgsConstructor
public class StudyController {

    // 导入study service
    private final StudyService studyService;

    @PostMapping("/list")
    public ResponseResult list(@RequestBody StudyQueryPage studyQueryPage) {
        PageResult studyList = studyService.getStudyList(studyQueryPage);
        return ResponseResult.okResult(studyList);
    }

}
